package com.pro.service.imple;

import com.pro.mapper.JsOrderMapper;
import com.pro.pojo.*;
import com.pro.service.JsOrderService;
import com.querydsl.core.types.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cyj
 * @date 2022.1.14$ 15.38$
 * @content :
 */
@Service
public class JsOrderServiceImple implements JsOrderService {

    @Autowired
    private JsOrderMapper mapper;
    /**
     * @author cyj
     * @date 2022.1.14$ 15.36$
     * @content :获取课程订单
     */
    @Override
    public List<JsOrder> getAllCourseOrder(String orderPaymentChannel, String orderSource, String orderStatus, Integer type,Integer comment) {
        return mapper.getAllCourseOrder(orderPaymentChannel,orderSource,orderStatus,type,comment);
    }

    /**
     * @author cyj
     * @date 2022.1.14$ 19.27$
     * @content :删除订单（商品，课程通用）包括退订
     */
    @Override
    public Boolean delCourseOrder(Integer id) {
        return mapper.delCourseOrder(id);
    }

    /**
     * @author cyj
     * @date 2022.1.14$ 19.44$
     * @content :获取一条用户详细信息
     */
    @Override
    public JsBeforeUser getUserMsg(Integer orderId) {
        return mapper.getUserMsg(orderId);
    }

    /**
     * @author cyj
     * @date 2022.1.15$ 9.45$
     * @content :获取商品订单
     */
    @Override
    public List<JsOrder> getAllGoodsOrder(String orderPaymentChannel, String Source, String Status, Integer type,Integer comment) {
        return mapper.getAllGoodsOrder(orderPaymentChannel,Source,Status,type,comment);
    }
    /**
     * @author cyj
     * @date 2022.1.15$ 12.02$
     * @content :获取退订订单
     */
    @Override
    public List<Order> getAllReturnMsg(String orderPaymentChannel,String orderSource,Integer Status){
        if(Status!=null){
            if(Status==100){
                return mapper.getAllReturnMsg(orderPaymentChannel,orderSource,Status);
            }
        }
        return mapper.getReturnMsg(orderPaymentChannel,orderSource,Status);
    }
    /**
     * @author cyj
     * @date 2022.1.18$ 18.14$
     * @content :查看商品订单统计
     */
    @Override
    public List<JsGoods> selectGoodsStatistics(Integer orderType) {
        return mapper.selectGoodsStatistics(orderType);
    }
    /**
     * @author cyj
     * @date 2022.1.18$ 18.49$
     * @content :查看echarts课程订单统计
     */
    @Override
    public List<JsCourse> selectCurriculumStatistics(Integer orderType){
        return mapper.selectCurriculumStatistics(orderType);
    }
}
